<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>样式绑定内联</title>
    <script src="../../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <p v-bind:style="{color:text_color,backgroundColor:bg_color}">示例文字</p>
        <p v-bind:style="[style_1,style_2]">示例文字</p>
    </div>
    <script>
        var v_app = new Vue({
            el: "#app",
            data: {
                text_color: "red",
                bg_color: "black",
                style_1: {
                    color: "yellow"
                },
                style_2: {
                    backgroundColor: "green"
                }
            }
        });
    </script>
</body>

</html>